package com.itqf.proxy.static_proxy;

/**
 * @Description:  中介类  代理房东租房子
 * @Company: 千锋互联
 * @Author: 李丽婷
 * @Date: 2020/9/28
 * @Time: 下午4:03
 */
public class ProxyRentHouse  implements  RentHouse{

    private HouseMaster houseMaster;

    public ProxyRentHouse( HouseMaster houseMaster){
        this.houseMaster = houseMaster;
    }

    @Override
    public void lookHouse() {
        System.out.println("带领租客去看房.....");//辅助功能   开启事务
        houseMaster.lookHouse();//
        System.out.println("看房完毕");//辅助功能  提交事务
        //回滚事务

    }

    @Override
    public void receiveMoney() {
        System.out.println("中介收租金");
        houseMaster.receiveMoney();
        System.out.println("收租金完毕");
    }

    @Override
    public void writeHeTong() {
        System.out.println("和中介签合同");
        houseMaster.writeHeTong();
    }

    //辅助功能
    public  void  WeiXiu(){
        System.out.println("维修");
    }
}
